package cn.gailvlun.gll.net.pay

import cn.gailvlun.gll.util.DateUtil
import cn.gailvlun.gll.util.StringUtil
import com.google.gson.annotations.SerializedName
import java.util.*

class PayOrderModel {
    
    @SerializedName(value = "orderno")
    var payNumber: String? = null

    fun getPayNumberOut(): String {
        return "订单号 $payNumber"
    }

    @SerializedName(value = "payway")
    var payMethod: PayMethod? = null

    @SerializedName(value = "date_update")
    var orderDate: Date? = null

    fun getOrderDateOut(): String {
        return DateUtil.format(DateUtil.NO_SECOND_PATTERN, orderDate)
    }

    var payStatus: String? = null
        get() {
            return when (status) {
                "0" -> "未支付"
                "1" -> "支付成功"
                else -> null
            }
        }

    
    fun getProbabilityPoint(): String {
        return StringUtil.format("{0, number,0.0}", fee / 100f)
    }

    
    var id: Int? = null
    private var status: String = "0"
    private var fee: Int = 0
}
